package com.ssm.service.Impl;

import com.ssm.dao.AccountDao;
import com.ssm.pojo.Account;
import com.ssm.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AccountServiceImpl implements AccountService {

    @Autowired
    private AccountDao accountDao;

    @Override
    public Integer save(Account account) {
        Integer save = accountDao.save(account);
        return save;
    }

    @Override
    public Integer update(Account account) {
        Integer update = accountDao.update(account);
        return update;
    }

    @Override
    public Integer delete(Integer id) {
        Integer delete = accountDao.delete(id);
        return delete;
    }

    @Override
    public List<Account> findAll() {
        List<Account> all = accountDao.findAll();
        return all;
    }

    @Override
    public List<Account> findById(Integer id) {
        List<Account> byId = accountDao.findById(id);
        return byId;
    }
}
